import 'dart:ui';

import 'package:get/get.dart';
import 'package:hibrid_flutter/gen/assets.gen.dart';
import 'package:hibrid_flutter/main.dart';
import 'package:hibrid_flutter/my_route.dart';

/// getx:该造步骤2:创建controller，集成GetxController
class MinePageController extends GetxController {
  // Getx该造步骤3：给变量值添加  .obs
  final _background = Assets.images.bgDouMine.path.obs;

  // 再次该造，避免background.value
  String get background => _background.value;

  set background(url) => _background.value = url;

  Size get screen => window.physicalSize;
//
  Future<void> onTapBackground() async {
    var fileUrl = await myRoute.push(name: MyRoute.photoPicker, args: {MyRoute.key_url: background});

    // 增加类型判断
    if (fileUrl is String) {
      background = fileUrl;
    }
  }


  /// 模拟用户信息
  UserInfo get userInfo => UserInfo(
        '文化袁',
        '抖音号：huahau',
        '+ 心情',
        '3w+',
        '346',
        '98w',
        '4500',
        '13号线西二旗，work~to~work',
        '29',
        '清华大学么',
        '+ 添加所在地标签',
      );
}

class UserInfo {
  String userName = '';
  String userNo = '';
  String userTemper = '';

  String praiseNum = '';
  String focusNum = '';
  String followNum = '';
  String friendNum = '';

  String description = '';

  String age = '';
  String school = '';
  String tagMore = '';

  UserInfo(
      this.userName,
      this.userNo,
      this.userTemper,
      this.praiseNum,
      this.focusNum,
      this.followNum,
      this.friendNum,
      this.description,
      this.age,
      this.school,
      this.tagMore);
}
